import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'components/CategoryTitle.dart';
import 'components/LinkButton.dart';
import 'components/PageWrap.dart';

class HomePage extends StatefulWidget {
  const HomePage({super.key, required this.title});

  final String title;

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return PageWrap(
      title: widget.title,
      children: [
        CategoryTitle(text: "基础组件"),
        LinkButton(
          text: "Text：文本及样式",
          url: "text_learn",
        ),
        LinkButton(
          text: "Button：按钮",
          url: "button_learn",
        ),
        LinkButton(
          text: "ImageAndIcon：图片及ICON",
          url: "image_andIcon_learn",
        ),
        LinkButton(
          text: "SwitchAndCheckbox：单选开关和复选框",
          url: "switch_and_checkbox_learn",
        ),
        LinkButton(
          text: "TextFieldAndForm：输入框及表单",
          url: "text_field_and_form_learn",
        ),
        LinkButton(
          text: "ProgressIndicator：进度指示器",
          url: "progress_indicator_learn",
        ),
        CategoryTitle(text: "布局类组件"),
        LinkButton(
          text: "Constrained：布局原理与约束",
          url: "constrained_learn",
        ),
        LinkButton(
          text: "RowAndColumn：线性布局",
          url: "row_and_column_learn",
        ),
        LinkButton(
          text: "Flex：弹性布局",
          url: "flex_learn",
        ),
        LinkButton(
          text: "WrapAndFlow：流式布局",
          url: "wrap_and_flow_learn",
        ),
        LinkButton(
          text: "StackAndPositioned：层叠布局",
          url: "stack_and_positioned_learn",
        ),
        LinkButton(
          text: "Align：对齐与相对定位",
          url: "align_learn",
        ),
        CategoryTitle(text: "容器类组件"),
        LinkButton(
          text: "Padding：填充",
          url: "padding_learn",
        ),
        LinkButton(
          text: "DecoratedBox：装饰容器",
          url: "decorated_box_learn",
        ),
        LinkButton(
          text: "Transform：变换",
          url: "transform_learn",
        ),
        LinkButton(
          text: "Container：容器组件",
          url: "container_learn",
        ),
        LinkButton(
          text: "Clip：剪裁",
          url: "clip_learn",
        ),
        LinkButton(
          text: "Scaffold：页面骨架",
          url: "scaffold_learn",
        ),
        CategoryTitle(text: "可滚动组件"),
        LinkButton(
          text: "SingleChildScrollView",
          url: "single_child_scroll_view_learn",
        ),
        LinkButton(
          text: "ListView 默认构造函数列表",
          url: "list_view_learn",
        ),
        LinkButton(
          text: "ListView 列表项不确定",
          url: "list_view_builder_learn",
        ),
        LinkButton(
          text: "ListView 无限加载列表",
          url: "list_view_no_limit_learn",
        ),
        LinkButton(
          text: "ListView 列表分割组件生成器",
          url: "list_view_separated_learn",
        ),
        LinkButton(
          text: "ListView 滚动监听及控制",
          url: "list_view_scroll_controller_learn",
        ),
        LinkButton(
          text: "ListView 滚动通知",
          url: "list_view_notification_learn",
        ),
        LinkButton(
          text: "AnimatedList 动画列表",
          url: "animated_listarn_learn",
        ),
        LinkButton(
          text: "GridView 网格布局",
          url: "gridView_learn",
        ),
        LinkButton(
          text: "PageView 页面切换",
          url: "page_viewLn_learn",
        ),
        LinkButton(
          text: "TabView 页面切换",
          url: "tab_view_learn",
        ),
        CategoryTitle(text: "功能型组件"),
        LinkButton(
          text: "WillPopScope 导航返回拦截",
          url: "willPop_scope_learn",
        ),
        LinkButton(
          text: "InheritedWidget 数据共享",
          url: "inherited_widget_learn",
        ),
        LinkButton(
          text: "ProviderRoute 跨组件状态共享",
          url: "provider_route_learn",
        ),
        LinkButton(
          text: "ThemeTestRoute 主题",
          url: "theme_route_learn",
        ),
        LinkButton(
          text: "FutureBuilder 异步UI更新",
          url: "future_builder_learn",
        ),
        CategoryTitle(text: "功能测试"),
        LinkButton(
          text: "Dio http库测试",
          url: "dio_learn",
        ),
      ],
    );
  }
}
